package com.ntschy.bt.entity.enums;


import com.baomidou.mybatisplus.annotation.EnumValue;
import com.baomidou.mybatisplus.core.enums.IEnum;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonValue;

/**
 *
 * @author lxr
 *
 * 是否为返回项
 */

@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum  BtHelpBackEnum implements IEnum<Integer> {

    /**
     * 退回分配项 0否 1是
     */
    NO(0, "否"),
    YES(1,"是");



//    @EnumValue
//    @JsonValue
    private final int value;

//    @JsonValue
    private final String desc;

    BtHelpBackEnum(int value,String desc){
        this.value = value;
        this.desc = desc;
    }

    @Override
    public Integer getValue() {
        return this.value;
    }

    public String getDesc() {
        return desc;
    }




    @JsonCreator
    public static BtHelpBackEnum BtHelpBackFromValue(Integer value){
        for (BtHelpBackEnum examineResult : BtHelpBackEnum.values()){
            if(examineResult.getValue() == value){
                return examineResult;
            }
        }

        return  null;
    }





}
